﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using DIT.Domain;
using DIT.Utility;

namespace DIT.Client.MVVM
{
    public static class CommonStatic
    {
        public const string CLIENT_STRING = "Client";
        public const string COMPUTATION_STRING = "Computation";
        public static IFormatProvider DateFormatProvider = CultureInfo.GetCultureInfoByIetfLanguageTag(DITConfig.AppSettings["Culture"]);
        public static DateTime Today
        {
            get
            {
                DateTime today;
                DateTime.TryParse(ConvertDate2String(DateTime.Today), CommonStatic.DateFormatProvider, DateTimeStyles.None, out today);
                return today;
            }
        }
        public static string ConvertDate2String(DateTime dateTime)
        {
            return dateTime.ToString(DITConfig.AppSettings["DateStringFormat"], DateFormatProvider);
        }
    }
}
